import 'package:flutter_homemonitor/generated/json/base/json_field.dart';
import 'package:flutter_homemonitor/generated/json/build_info_entity.g.dart';
import 'dart:convert';
export 'package:flutter_homemonitor/generated/json/build_info_entity.g.dart';

List<BuildInfoEntity> getBuildInfoList(List<dynamic> list) {
  List<BuildInfoEntity> result = [];
  list.forEach((item) {
    result.add(BuildInfoEntity.fromJson(item));
  });
  return result;
}

@JsonSerializable()
class BuildInfoEntity {
  @JSONField(name: "Id")
  late int id;
  @JSONField(name: "RowID")
  late String rowID = '';
  @JSONField(name: "DetectItemID")
  late int detectItemID;
  @JSONField(name: "DetectItemDto")
  dynamic detectItemDto;
  @JSONField(name: "BuildingName")
  late String buildingName = '';
  @JSONField(name: "ProjectManagerName")
  dynamic projectManagerName;
  @JSONField(name: "BuildingAddress")
  late String buildingAddress = '';
  @JSONField(name: "Floors")
  late int floors;
  @JSONField(name: "UndergroundFloors")
  late int undergroundFloors;
  @JSONField(name: "BuildingTypeUses")
  dynamic buildingTypeUses;
  @JSONField(name: "BuildingBuiltYears")
  dynamic buildingBuiltYears;
  @JSONField(name: "BuildingPlaneForm")
  dynamic buildingPlaneForm;
  @JSONField(name: "CameraNumber")
  dynamic cameraNumber;
  @JSONField(name: "ExteriorWallFacing")
  dynamic exteriorWallFacing;
  @JSONField(name: "StructuralSystem")
  dynamic structuralSystem;
  @JSONField(name: "VerticalLoadBearingMember")
  dynamic verticalLoadBearingMember;
  @JSONField(name: "HorizontalLoadBearingMember")
  dynamic horizontalLoadBearingMember;
  @JSONField(name: "RoofForms")
  dynamic roofForms;
  @JSONField(name: "DoorsAndWindows")
  dynamic doorsAndWindows;
  @JSONField(name: "Stairs")
  dynamic stairs;
  @JSONField(name: "WhetherChanges")
  dynamic whetherChanges;
  @JSONField(name: "SalientFeatures")
  dynamic salientFeatures;
  @JSONField(name: "DetectMan")
  late String detectMan = '';
  @JSONField(name: "RecordMan")
  dynamic recordMan;
  @JSONField(name: "CheckMan")
  late String checkMan = '';
  @JSONField(name: "DetectTime")
  late String detectTime = '';
  @JSONField(name: "Remark")
  dynamic remark;
  @JSONField(name: "IsDelete")
  late bool isDelete = false;
  @JSONField(name: "DetectPictureList")
  dynamic detectPictureList;

  BuildInfoEntity();

  factory BuildInfoEntity.fromJson(Map<String, dynamic> json) =>
      $BuildInfoEntityFromJson(json);

  Map<String, dynamic> toJson() => $BuildInfoEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
